package com.epoint.mobileoa.tools;


import android.content.Context;
import android.content.res.AssetFileDescriptor;
import android.media.MediaPlayer;

/**
 * @author liyc
 * @time 2012-3-19 下午4:46:03
 * @annotation 
 */
public class MusicHelp {
	public static void playMusic(Context con,String filename){
		try{
			MediaPlayer m = new MediaPlayer();
			AssetFileDescriptor descriptor = con.getAssets().openFd(
					filename);
			m.setDataSource(descriptor.getFileDescriptor(),
					descriptor.getStartOffset(), descriptor.getLength());
			descriptor.close();
			m.prepare();
			m.start();
		}catch(Exception e){
			e.printStackTrace();
		}
	}
}
